//移入移出
if(document.body.offsetWidth>600){
    var rr = document.querySelector("#rr");
    var hh = document.querySelector(".hh");

    rr.addEventListener("mouseover",function () {
        hh.style.display = "block";
    });
    rr.addEventListener("mouseleave",function () {
        hh.style.display = "none";
    });
    hh.addEventListener("mouseover",function () {
        hh.style.display = "block";
    });
    hh.addEventListener("mouseleave",function () {
        hh.style.display = "none";
    });
}


if(document.body.offsetWidth>600) {
    var oo = document.querySelector("#oo");
    var ee = document.querySelector("#ee");
    oo.addEventListener("mouseover", function () {
        ee.style.top = "56px";
    });
    ee.addEventListener("mouseleave", function () {
        ee.style.top = "-420px";
    });
}









var swiper = new Swiper('.swiper-container', {
    spaceBetween: 30,
    centeredSlides: true,
    autoplay: {
        delay: 2500,
        disableOnInteraction: false,
    },
    pagination: {
        el: '.swiper-pagination',
        clickable: true,
    },
    navigation: {
        nextEl: '.swiper-button-next',
        prevEl: '.swiper-button-prev',
    },
    loop:true,
});




//返回顶部效果
var t = document.querySelector("#toTop");
window.onscroll = function () {
    console.log(document.documentElement.scrollTop > 500 || document.body.scrollTop > 500);
    if (document.documentElement.scrollTop > 500 || document.body.scrollTop > 500){
        t.style.display = "block";
    }else {
        t.style.display = "none";
    }
}

//点击返回顶部

t.addEventListener( 'click',function () {
    //让  dcrollto 支持平滑滚动
    window.scrollTo({
        top:0,
        behavior:'smooth'
    })
})

